import request from '@/utils/request'

//查询未推荐视频列表
export function listData(query) {
    return request({
      url: 'PublishVideo/getPublishVideo',
      method: 'get',
      params: query
    })
}

//查询已推荐视频列表
export function listDataT(query) {
  return request({
    url: 'PublishVideo/getPublishVideoT',
    method: 'get',
    params: query
  })
}

//查询已下架视频列表
export function listDataX(query) {
  return request({
    url: 'PublishVideo/getPublishVideoX',
    method: 'get',
    params: query
  })
}

//查询视频详情列表
export function listDataById(vid) {
  return request({
    url: 'PublishVideo/getPublishVideoById/' + vid,
    method: 'get',
  })
}

// 删除运营视频
export function delData(videoIds) {
  return request({
    url: 'PublishVideo/deleteVideoById/' + videoIds,
    method: 'put',
  })
}

// 绑定视频池（推荐、取消推荐
export function bindData(videoIds) {
  return request({
    url: 'PublishVideo/bindVideo/' + videoIds,
    method: 'put',
  })
}

// 新增视频数据
export function addData(data) {
  return request({
    url: 'PublishVideo/saveVideo',
    method: 'post',
    data: data
  })
}

// 修改视频数据
export function updateData(data) {
  return request({
    url: 'PublishVideo/updateVideo',
    method: 'put',
    data: data
  })
}

// 删除服务器视频
export function delVideoById(id) {
  return request({
    url: 'PublishVideo/deleteByVideoId/' + id,
    method: 'delete',
  })
}

// 删除服务器视频封面
export function deleteVideoCoverById(id) {
  return request({
    url: 'PublishVideo/deleteVideoCoverById/' + id,
    method: 'delete',
  })
}

